// 设置body背景色为白色
exports.bodyWhiteBg = {
  data() {
    return {
      bodyClass: ''
    }
  },
  beforeRouteEnter (to, from, next) {
    let bodyClass = document.body.className
    document.body.className = 'bg-white'
    next(vm => {
      vm.bodyClass = bodyClass
    })
  },
  beforeRouteLeave  (to, from, next) {
    document.body.className = this.bodyClass
    next()
  }
}

// 设置body背景色为灰色
exports.bodyGrayBg = {
  data() {
    return {
      bodyClass: ''
    }
  },
  beforeRouteEnter (to, from, next) {
    let bodyClass = document.body.className
    document.body.className = 'bg-gray'
    next(vm => {
      vm.bodyClass = bodyClass
    })
  },
  beforeRouteLeave  (to, from, next) {
    document.body.className = this.bodyClass
    next()
  }
}